﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using Common.Utility;
using DataInterpolator.Model;
using GalaSoft.MvvmLight;

namespace DataInterpolator.ViewModel
{
   public class WellVMO : Common.ViewModel.WellBase
   {
      public WellVMO(Well well) : base()
      {
         ID = well.ID;
         _Title = well.Title;
         _TimeDatum = well.TimeDatum;
         _KB = well.KB;
         _SampleRate = well.SampleRate;
         _SeismicDatum = well.SeismicDatum;
         _SeismicVelocity = well.SeismicVelocity;
         LogData = well.LogData;
         TopsData = well.Tops;
         OutputData = well.OutputData;
         IsoData = well.IsoData;
      }

      public Guid ID
      {
         get; private set;
      }

      /// <summary>
      /// The <see cref="TimeDatum" /> property's name.
      /// </summary>
      public const string TimeDatumPropertyName = "TimeDatum";

      private double _TimeDatum = 0.0;

      /// <summary>
      /// Sets and gets the TimeDatum property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// </summary>
      public double TimeDatum
      {
         get
         {
            return _TimeDatum;
         }

         set
         {
            if (_TimeDatum == value)
            {
               return;
            }

            _TimeDatum = value;
            RaisePropertyChanged(TimeDatumPropertyName);
         }
      }

      /// <summary>
      /// The <see cref="KB" /> property's name.
      /// </summary>
      public const string KBPropertyName = "KB";

      private double _KB = 0.0;

      /// <summary>
      /// Sets and gets the KB property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// </summary>
      public double KB
      {
         get
         {
            return _KB;
         }

         set
         {
            if (_KB == value)
            {
               return;
            }

            _KB = value;
            RaisePropertyChanged(KBPropertyName);
         }
      }

      /// <summary>
      /// The <see cref="SampleRate" /> property's name.
      /// </summary>
      public const string SampleRatePropertyName = "SampleRate";

      private double _SampleRate = 0.0;

      /// <summary>
      /// Sets and gets the SampleRate property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// </summary>
      public double SampleRate
      {
         get
         {
            return _SampleRate;
         }

         set
         {
            if (_SampleRate == value)
            {
               return;
            }

            _SampleRate = value;
            RaisePropertyChanged(SampleRatePropertyName);
         }
      }

      /// <summary>
      /// The <see cref="SeismicDatum" /> property's name.
      /// </summary>
      public const string SeismicDatumPropertyName = "SeismicDatum";

      private double _SeismicDatum = double.NaN;

      /// <summary>
      /// Sets and gets the SeismicDatum property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// </summary>
      public double SeismicDatum
      {
         get
         {
            return _SeismicDatum;
         }

         set
         {
            if (_SeismicDatum == value)
            {
               return;
            }

            _SeismicDatum = value;
            RaisePropertyChanged(SeismicDatumPropertyName);
         }
      }

      /// <summary>
      /// The <see cref="SeismicVelocity" /> property's name.
      /// </summary>
      public const string SeismicVelocityPropertyName = "SeismicVelocity";

      private double _SeismicVelocity = double.NaN;

      /// <summary>
      /// Sets and gets the SeismicVelocity property.
      /// Changes to that property's value raise the PropertyChanged event. 
      /// </summary>
      public double SeismicVelocity
      {
         get
         {
            return _SeismicVelocity;
         }

         set
         {
            if (_SeismicVelocity == value)
            {
               return;
            }

            _SeismicVelocity = value;
            RaisePropertyChanged(SeismicVelocityPropertyName);
         }
      }

      public Well_LogData LogData
      {
         get; private set;
      }

      public Well_Tops TopsData
      {
         get; private set;
      }

      public Well_OutputData OutputData
      {
         get; private set;
      }

      public Well_IsoData IsoData
      {
         get; private set;
      }
   }
}
